package ckw.database;

import java.io.Serializable;

public class AdministratorToken extends
		core.modules.database.SuperAdministratorToken implements Serializable {

	private static final long serialVersionUID = -2427306316390129292L;

	private OKWMember okwmember;
	private Election election;

	public AdministratorToken() {
		super();
	}

	public AdministratorToken(String value) {
		super(value);
	}

	public OKWMember getOkwmember() {
		return okwmember;
	}

	public void setOkwmember(OKWMember okwmember) {
		this.okwmember = okwmember;
	}

	public void addToOkwmember(OKWMember okwMember) {
		this.setOkwmember(okwMember);
		okwMember.getAdministratorTokens().add(this);
	}

	public void removeFromOkwmember(OKWMember okwMember) {
		this.setOkwmember(null);
		okwMember.getAdministratorTokens().remove(this);
	}

	public Election getElection() {
		return election;
	}

	public void setElection(Election election) {
		this.election = election;
	}

	public void addToElection(Election election) {
		this.setElection(election);
		election.getAdministratorTokens().add(this);
	}

	public void removeFromElection(Election election) {
		this.setElection(null);
		election.getAdministratorTokens().remove(this);
	}
}
